﻿<?php
require_once('../db/check_login.php');
require_once('../db/config.php');
$db=new db($config);
$columnsData=$db->foundbyWhere('columns');
?>
<p><a href="add.php">添加栏目</a></p>
<table width="100%" border="0">
  <tr>
    <td width="15%" align="center">栏目名称</td>
    <td width="20%" align="center">权限值</td>
    <td width="20%" align="center">排序</td>
    <td width="45%" align="center">操作</td>
  </tr>
  <?php if(!empty($columnsData)&&is_array($columnsData)):?>
  <?php foreach($columnsData as $value): ?> 
  <tr>
    <td align="center"><?php echo $value['name']?></td>
 
    <td align="center">
   <?php echo $value['power']?>
    </td>
    <td align="center">
   <?php echo $value['sort']?>
    </td>
    <td align="center"><a href="update.php?id=<?php echo $value['id'];?>">修改</a>&nbsp;<a href="del.php?id=<?php echo $value['id'];?>">删除</a></td>
  </tr>
  <?php endforeach;?>
  <?php else :?>
  <td align="center">暂无记录</td>
  <?php endif;?>
</table>
